<?php

/**
 * Historico form base class.
 *
 * @package    form
 * @subpackage historico
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseHistoricoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_historico'    => new sfWidgetFormInputHidden(),
      'url_historico'   => new sfWidgetFormInput(),
      'id_item_sistema' => new sfWidgetFormDoctrineChoice(array('model' => 'ItemSistema', 'add_empty' => true)),
      'user_id'         => new sfWidgetFormInput(),
      'created_at'      => new sfWidgetFormDateTime(),
      'updated_at'      => new sfWidgetFormDateTime(),
      'deleted'         => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'id_historico'    => new sfValidatorDoctrineChoice(array('model' => 'Historico', 'column' => 'id_historico', 'required' => false)),
      'url_historico'   => new sfValidatorString(array('max_length' => 255)),
      'id_item_sistema' => new sfValidatorDoctrineChoice(array('model' => 'ItemSistema', 'required' => false)),
      'user_id'         => new sfValidatorInteger(array('required' => false)),
      'created_at'      => new sfValidatorDateTime(array('required' => false)),
      'updated_at'      => new sfValidatorDateTime(array('required' => false)),
      'deleted'         => new sfValidatorBoolean(),
    ));

    $this->widgetSchema->setNameFormat('historico[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Historico';
  }

}
